package com.sunfeng.n3;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @author sunfeng
 * @date 2021/03/16 14:59
 **/

@Slf4j(topic = "c.Test9")
public class Test9 {

    private static int r=0;

    public static void main(String[] args) throws InterruptedException {

        Thread t1 = new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(1);
                r=10;
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "t1");
        t1.start();
        t1.join();

        log.info("{}",r);

    }
}
